import * as React from 'react';
import { forwardRef, createElement } from 'react';
import './index.scss';

export interface LogoProps {
  /**
   * 点击事件
   */
  onClick?: () => void;

  /**
   * 自定义样式
   */
  style?: React.CSSProperties;

  /**
   * 自定义类名
   */
  className?: string;

  // 低代码平台相关属性（不会传递到DOM）
  __designMode?: string;
  componentId?: string;
  _componentName?: string;
  forwardRef?: any;
}

const Logo = forwardRef<HTMLDivElement, LogoProps>((props, ref) => {
  const {
    onClick,
    style = {},
    className = '',
    // 过滤掉低代码平台相关属性，不传递到DOM
    __designMode,
    componentId,
    _componentName,
    forwardRef: forwardRefProp,
    ...otherProps
  } = props;

  const logoClassName = ['hzdz-logo', className].filter(Boolean).join(' ');

  return createElement('div', {
    ref,
    className: logoClassName,
    style,
    onClick,
    ...otherProps
  });
});

Logo.displayName = 'Logo';

export default Logo; 